package com.fire.communication.support.annotaion;

import com.fire.communication.support.annotaion.enums.AuthType;
import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@RequestMapping
public @interface At {

	@AliasFor(annotation = RequestMapping.class)
	String[] path() default {};

	@AliasFor(annotation = RequestMapping.class)
	String[] value() default {};

	@AliasFor(annotation = RequestMapping.class)
	RequestMethod[] method() default {};

	@AliasFor(annotation = RequestMapping.class)
	String[] produces() default {};

	/**
	 * 参数校验名称
	 * 
	 * @return
	 */
	String[] param() default {};

	/**
	 * 参数长度校验
	 * 
	 * @return
	 */
	Len[] len() default { @Len(name = "_all_", value = 5000) };

	/**
	 * 权限校验类型,默认不校验
	 * 
	 * @return
	 */
	AuthType authType() default AuthType.NOSET;

}
